<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="lib/vue-2.4.0.js"></script>
</head>
<body>
<div id="app">
    <hello-world></hello-world>
    <hello-tom></hello-tom>
    <hello-mike></hello-mike>
    <test-com></test-com>
</div>
<script>
    Vue.component('test-com',{
        template:'<div>Test</div>'
    })
    // 局部组件
    var HelloWorld={
        data(){
            return{
                msg:'HelloWorld'
            }
        },
        template:'<div>{{msg}}</div>'
    }
    var HelloTom={
        data(){
            return{
                msg:'HelloTom'
            }
        },
        template:'<div>{{msg}}</div>'
    }
    var HelloMike={
        data(){
            return{
                msg:'HelloMike'
            }
        },
        template:'<div>{{msg}}</div>'
    }
    var vm=new Vue({
        el:'#app',
        data:{},
        components:{
            'hello-world':HelloWorld,
            'hello-tom':HelloTom,
            'hello-mike':HelloMike,
        }
    })
</script>
</body>
</html>